﻿using AuSys.Services.App.UserInfo.Abstractions;
using Microsoft.AspNetCore.Http;

namespace AuSys.Test.TestSupport.Fakes
{
    internal class FakeUserIdProvider: IUserIdProvider
    {
        public static int AsUserId { get; set; }
        public static Stack<int>? AsUserIds { get; set; }
        public int GetUserId()
        {
            if(AsUserIds is { })
                return AsUserIds.Pop();
            return AsUserId;
        }
        public static void SetUserIds(List<int> uids)
        {
            AsUserIds = [];
            uids.Reverse();
            uids.ForEach(AsUserIds.Push);
        }
    }
}
